package net.xxcxcxcx.xc_enhancedmob.mixin.client;

import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
import net.minecraft.client.render.Camera;
import net.minecraft.client.render.GameRenderer;
import net.minecraft.client.render.LightmapTextureManager;
import net.minecraft.client.render.WorldRenderer;
import net.minecraft.client.util.math.MatrixStack;
import net.minecraft.util.math.Matrix4f;
import net.xxcxcxcx.xc_enhancedmob.render.damage_num.DamageNumRenderer;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;

@Environment(value = EnvType.CLIENT)
@Mixin({WorldRenderer.class})
public class WorldRendererMixin {
    @Inject(
            method = {"render"},
            at = {@At("RETURN")}
    )
    //render Damage Particles
    private void renderDamageParticle(MatrixStack matrices, float tickDelta, long limitTime, boolean renderBlockOutline, Camera camera, GameRenderer gameRenderer, LightmapTextureManager lightmapTextureManager, Matrix4f matrix, CallbackInfo info) {
        //System.out.println("Damage Number Rendering");
        DamageNumRenderer.renderParticles(matrices, camera);
    }
}
